const express = require('express');
const router = express.Router();
const authController = require('../controllers/authController');
const { authMiddleware } = require('../middleware/auth');

// 管理员登录
router.post('/admin/login', authController.adminLogin);

// 客户端用户注册
router.post('/user/register', authController.userRegister);

// 客户端用户登录
router.post('/user/login', authController.userLogin);

// 🔥 上传客户端ID（需要认证）
router.post('/upload-client-id', authMiddleware, authController.uploadClientId);

// 退出登录
router.post('/logout', authMiddleware, authController.logout);

module.exports = router;
